#!/bin/sh
cd "$(dirname "$0")"
cd ../..
cd vtk
mkdir -p build
cd build
CFLAGS=-fPIC CXXFLAGS=-fPIC cmake -DBUILD_TESTING:BOOL=FALSE -DCMAKE_BUILD_TYPE:String="Release" -DBUILD_WITH_DEBUG_INFO:BOOL=FALSE -DBUILD_SHARED_LIBS:BOOL=FALSE ../
make
cd ../..

cd platforms/raspbian
mkdir -p build
cd build
cmake -DBUILD_TESTS:BOOL=FALSE -DBUILD_PERF_TESTS:BOOL=FALSE -DBUILD_opencv_apps:BOOL=FALSE -DBUILD_DOCS:BOOL=FALSE -DWITH_TBB:BOOL=FALSE -DWITH_OPENMP:BOOL=TRUE -DWITH_CUDA:BOOL=FALSE -DWITH_IPP:BOOL=FALSE -DOPENCV_EXTRA_MODULES_PATH=../../../opencv_contrib/modules -DBUILD_opencv_ts:BOOL=FALSE -DBUILD_WITH_DEBUG_INFO:BOOL=FALSE -DBUILD_SHARED_LIBS:BOOL=FALSE -DVTK_DIR:String="$PWD/../../../vtk/build" -DCMAKE_BUILD_TYPE:String="Release" -DWITH_TESSERACT:BOOL=FALSE -DEMGU_CV_WITH_TESSERACT:BOOL=TRUE -DWITH_EIGEN:BOOL=FALSE -DBUILD_TIFF:BOOL=TRUE -DEMGU_CV_WITH_TIFF:BOOL=FALSE -DBUILD_opencv_python2:BOOL=FALSE -DBUILD_opencv_python3:BOOL=FALSE ../../..
make
cd ..
#mkdir -p libs/arm
#cp build/libcvextern.so libs/arm/libcvextern.so
#cd ..
